Ext.define('extjs6test.view.base.BaseManagerController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.basemngr',
    onBaseAdd: function (button, evt) {
        console.log("this is onBaseAdd");
    },
    onBaseModify: function (button, evt) {
        console.log("this is onBaseModify");
    },
    onBaseRemove: function (button, evt) {
        console.log("this is onBaseRemove");
    },
    onBaseQuery: function (button, evt) {
        console.log("this is onBaseQuery");
        var grid = button.up('panel').down('grid');
        var store = grid.getStore();
        store.load();
    },
    onBaseExportPDF: function (button, evt) {
        console.log("this is onBaseExportPDF");
    },
    onBaseExportExcel: function (component, evt) { //公共导出excel
        console.log("this is onBaseExportExcel");
        var grid = this.getView().down('grid');

        if (grid != null) {
            grid.saveDocumentAs({
                type:'excel',
                title:'Export Grid',
                fileName:'gridExport.xls'
            });
        }
    },
    onBaseImportExcel:function (button) {  //公共导入excel
        console.log("this is onBaseImportExcel");
    }
});